package com.nowcoder.community.dao;

import com.nowcoder.community.entity.Comment;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface CommentMapper {

    //评论列表
    List<Comment> selectCommentByEntity(int entityType,int entityId,int offset,int limit);
    //评论数量
    int seletctCountByEntity(int entityType,int entityId);
    //添加评论
    int insertComment(Comment comment);
    //查找评论
    Comment selectCommentById(int id);

    //查找用户的评论
    List<Comment> selectCommentsByUser(int userId,int offset,int limit);

    //查找用户的评论数
    int selectCommentCountByUser(int userId);


}
